home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / bbsxdemo.lzh / OE / OE.SCR < prev    next >
Text File  |  1993-01-03  |  16KB  |  591 lines

  1. script
  2.  
  3. ;     Online Order Entry System for BBS Express! ST
  4. ;       written by Keith Ledbetter     14-Sept-87
  5. ;     ---------------------------------------------
  6.  
  7.  abort off
  8.  
  9.  clear screen
  10.  define   Top_Of_Page                ;item # at top of screen
  11.  define   Total_items
  12.  define   Instr                      ;generic input field
  13.  define   Count
  14.  define   Temp
  15.  define   Pointer                    ;generic pointer field
  16.  
  17.  define  Text_Path       = 'd:\bbsxdemo\oe\dat\'             ;where the text is
  18.  define  orders_filename = 'd:\bbsxdemo\oe\dat\orders.dat'   ;orders dataset
  19.  define  info_filename   = 'd:\bbsxdemo\oe\dat\info.dat'     ;info dataset
  20.  
  21.  define  Allow_MasterCard = 'YES'    ;change these to the        <<--------
  22.  define  Allow_VISA       = 'YES'    ; credit cards you want to
  23.  define  Allow_AMExpress  = 'YES'    ; allow..  ('YES' or 'NO')
  24.  define  Allow_COD        = 'YES'    ; >>> NOTE: NOT IN USE YET!
  25.  
  26.  define  Datafile                   ;the data file we're reading now
  27.  define  Return_To                  ;file to execute when done
  28.  
  29.  define  product                 ;the product they are ordering
  30.  define  quantity                ;quantity they want
  31.  define  name                    ;to ship to
  32.  define  address
  33.  define  city
  34.  define  state
  35.  define  zip_code
  36.  define  day_phone
  37.  define  night_phone
  38.  define  payment_type
  39.  define  acct_number              ;(if charge)
  40.  define  exp_date                 ;card's expiration date
  41.  define  bank_name                ;bank name
  42.  define  bank_number              ;bank number (if Mastercard)
  43.  define  spec_instr               ;special instructions
  44.  define  video_width  = '&11'     ;user's video width
  45.  define  current_time = '&23'     ;timestamp
  46.  define  current_date = '&24'     ;datestamp
  47.  define  price
  48.  define  already_asked            ;already asked for info?
  49.  
  50.  [name]        =  &2              ;user's REAL name (from logon record)
  51.  [address]     =  &4
  52.  [city]        =  &5
  53.  [state]       =  &6
  54.  [zip_code]    =  &7
  55.  [day_phone]   =  &8
  56.  [night_phone] =  &8
  57.  
  58.  
  59. ;       Process the category selection
  60. ;       ------------------------------
  61.  
  62. get_category:
  63.  
  64.         [top_of_page] = 1                ; to top of file..
  65.         clear screen
  66.         clear table
  67.         total_items = table_load ('[text_path]category.dat')
  68.         if total_items = 0 then
  69.            printe 'Sorry...that area is being built!'
  70.            exit
  71.         endif
  72.  
  73. GC_main_loop:
  74.   clear screen
  75.   printe
  76.   printe '--------------------------------------' center
  77.   printe ' DEMO VERSION! MAY NOT BE UP TO DATE! ' center
  78.   printe '--------------------------------------' center
  79.   PRINTE
  80.   printe '-------------------------------------' center
  81.   printe ' #   Product Category Selection      ' center
  82.   printe '-------------------------------------' center
  83.  
  84.   gosub get10_items                             ;get a page worth of data
  85.  
  86.  
  87.   printe
  88. GC_re_get:
  89.   print 'P)rev N)ext Q)uit #) To View: ' center
  90.   input [instr] 2
  91.   if [instr] = ''  then
  92.      increase [top_of_page] 10
  93.      goto GC_main_loop
  94.   ef [instr] = NUMERIC then
  95.      goto get_cat_selection
  96.   ef [instr] = 'N' then
  97.      increase [top_of_page] 10
  98.      goto GC_main_loop
  99.   ef [instr] = 'P' then
  100.      decrease [top_of_page] 10
  101.      goto GC_main_loop
  102.   ef [instr] = 'Q' then
  103.      exit
  104.   else
  105.      goto GC_re_get
  106.   endif
  107.  
  108. get_cat_selection:
  109.   if [instr] < 1
  110.      goto GC_re_get
  111.   ef [instr] > [total_items]
  112.      goto GC_re_get
  113.   endif
  114.   datafile    = table_get(instr)
  115.   datafile    = copy (datafile, 36, 12)
  116.   top_of_page = 1                            ; to top of file..
  117.   goto process_items
  118.  
  119.  
  120.  
  121. process_items:
  122.  
  123.         if file_exists ('[text_path][datafile]')
  124.         else
  125. get_out:
  126.            printe '\n\nSorry, that area is under construction!'
  127.            print  '\nPress return...'
  128.            input [instr] 1
  129. leave:
  130.            close
  131.            goto Get_category
  132.         endif
  133.  
  134.         total_items = table_load ('[text_path][datafile]')
  135.  
  136.         if [total_items] = 0
  137.            goto get_out
  138.         endif
  139.  
  140.         clear screen
  141.  
  142. PI_main_loop:
  143.   clear screen
  144.   printe
  145.   printe '-------------------------------------' center
  146.   printe ' #   Product                   Price ' center
  147.   printe '-------------------------------------' center
  148.  
  149.   gosub get10_items                             ;get a page worth of data
  150.  
  151.  
  152.   printe
  153. re_get:
  154.   print 'P)rev N)ext Q)uit #) To View: ' center
  155.   input [instr] 2
  156.  
  157.   if [instr] = ''  then
  158.      increase [top_of_page] 10
  159.      goto PI_main_loop
  160.   ef [instr] = NUMERIC then
  161.      goto info
  162.   ef [instr] = 'N' then
  163.      increase [top_of_page] 10
  164.      goto PI_main_loop
  165.   ef [instr] = 'P' then
  166.      decrease [top_of_page] 10
  167.      goto PI_main_loop
  168.   ef [instr] = 'Q' then
  169.      goto leave
  170.   else
  171.      goto re_get
  172.   endif
  173.  
  174.  
  175. info:
  176.   if [instr] < 1
  177.      goto re_get
  178.   ef [instr] > [total_items]
  179.      goto re_get
  180.   endif
  181.   instr = table_get (instr)
  182.  
  183.   if video_width = 40 then
  184.      temp = copy (instr, 36, 12)
  185.   else
  186.      temp = copy (instr, 50, 12)
  187.   endif
  188.  
  189.   if file_exists ('[text_path][temp]')
  190.      clear screen
  191.      view ('[text_path][temp]')
  192.   else
  193.      PrintE
  194.      PrintE 'No info available on that product' center
  195.   endif
  196.   print '\n\n'
  197.   if video_width = 40 then
  198.      print '(O)rder  (R)equest info  (C)ont: ' center
  199.   else
  200.   print '(O)rder this product  (R)equest info on this product  (C)ont: ' center
  201.   endif
  202.  
  203.   input [temp] 1
  204.   if [temp] = 'O'
  205.      goto go_order
  206.   ef [temp] = 'R'
  207.      goto go_info
  208.   endif
  209.   goto PI_main_loop
  210.  
  211.  
  212. go_order:
  213.   product = copy (instr, 1, 26)
  214.   price   = copy (instr, 28, 6)
  215.   goto Process_order
  216.  
  217.  
  218. go_info:
  219.   product = copy (instr, 1, 26)
  220.   price   = copy (instr, 28, 6)
  221.   goto Process_info
  222.  
  223.  
  224. get10_items:
  225.    if [top_of_page] < 1 then
  226.       [top_of_page] = 1
  227.    endif
  228.    set [pointer] = [top_of_page] + 9
  229.    if [pointer] > [total_items] then
  230.       set [top_of_page] = [total_items] - 9
  231.    endif
  232.    if [top_of_page] < 1 then
  233.       [top_of_page] = 1
  234.    endif
  235.    set [pointer] = [top_of_page]
  236.    set [count] = 1
  237. get10a:
  238.    instr = table_get (pointer)
  239.    if [instr] = '' then
  240.       set [instr] = ' '
  241.       expand [instr] 35
  242.    endif
  243.    instr = copy (instr, 1, 33)
  244.    set [temp] = [pointer]
  245.    if [temp] < 10
  246.       set [temp] = ' [temp]'
  247.    endif
  248.    printe '[temp]. [instr]' center
  249.    increase [pointer]
  250.    increase [count]
  251.    if [pointer] > [total_items] then
  252.       printe
  253.       printe '*** End of Products ***' Center
  254.    ef [count] < 11 then
  255.       goto get10a
  256.    endif
  257.    RETURN
  258.  
  259.  
  260. Process_Order:
  261. abort off
  262.  
  263.   clear screen
  264.   printe '\n\nORDERING: [product]'
  265.   printe '   PRICE: [price]\n'
  266.  
  267.   printe '\iNOTE:\o'
  268.  
  269.   if [video_width] = 40 then
  270.      printe ' You MUST leave 2 valid voice numbers,'
  271.      printe 'since we will validate this order by'
  272.      printe ' a telephone call!'
  273.      printe
  274.      printe ' Credit Card Purchases REQUIRE a'
  275.      printe ' $40 minimum order.!'
  276.      printe
  277.      printe ' IF THE ORDER FORM IS NOT TOTALLY'
  278.      printe ' FILLED OUT, IT WILL BE IGNORED!'
  279.      printe
  280.      printe ' There is a $4.00 minimum shipping'
  281.      printe ' charge on your total order.'
  282.      printe
  283.      printe ' You can ABORT this order at ANY time'
  284.      printe 'by entering "ABORT" at the main prompt.'
  285.   else
  286.      printe 'You MUST leave 2 valid voice numbers, since we will'
  287.      printe 'validate this order by a telephone call!'
  288.      printe
  289.      printe ' Credit Card Purchases REQUIRE a $40 minimum order.!'
  290.      printe
  291.      printe ' IF THE ORDER FORM IS NOT TOTALLY FILLED OUT, IT WILL BE IGNORED!'
  292.      printe
  293.      printe ' There is a $4.00 minimum shipping charge on your total order.'
  294.      printe
  295.      print  ' You can ABORT this order at ANY time '
  296.      printe 'by entering "ABORT" at the main prompt.'
  297.   endif
  298.  
  299.   printe
  300.   print 'Press <return> to fill out order form..'
  301.  
  302.   input [instr] 5
  303.  
  304.   if [instr] = 'abort'
  305.      goto GO_done
  306.   endif
  307.  
  308.   set [quantity]     = '(not yet entered)'
  309.   set [payment_type] = '(not yet entered)'